{extend name="public:base" /}
{block name="css"}
<link rel="stylesheet" href="__ADMIN__/css/adminPage.css"  media="all">
{/block}
{block name="content"}

<a class="layui-btn layui-btn-normal" href='{:url("Banner/add")}' >添加广告</a>

<table class="layui-table">
    <colgroup>
        <col width="60">
        <col width="100">
        <col width="200">
        <col width="200">
        <col width="200">
        <col width="200">
        <col width="100">
        <col width="200">
        <col width="200">
    </colgroup>
    <thead>
    <tr>
        <th>ID</th>
        <th>排序</th>
        <th>名字</th>
        <th>图片</th>
       <!--  <th>链接</th>
        <th>是否跳转</th> -->
        <th>状态</th>
        <th>添加时间</th>
        <th>操作</th>
    </tr>
    </thead>
    <tbody>
    {foreach $list as $v}
    <tr>
        <td>{$v.id}</td>
        <td>{$v.sort}</td>
        <td>{$v.name}</td>
        <td>
            <img src="{$v.images}" style="width: 60px;height: 60px;">
        </td>
        <!--  <td>{$v.url}</td>
          <td>
            {$v.is_url == 2 ? '<span>不</span>' : '<span style="color: red">跳转</span>'}
        </td> -->
        <td>
            {$v.status == 2 ? '<span>不显示</span>' : '<span style="color: red">显示</span>'}
        </td>
        <td>
            {$v.add_time|date="y-m-d H:i",###}
        </td>
        <td>
            <div class="layui-table-cell laytable-cell-1-10">

                <a  class="layui-btn layui-btn-mini" href='{:url("Banner/add",array("id"=>$v["id"]))}' lay-event="edit">编辑</a>

                {if condition="$v.status eq 2"}
                <a onclick="saveStatusVal(this,'{$v.id}',1)" data-url='{:url("Banner/saveStatus")}' class="layui-btn layui-btn-normal layui-btn-mini" lay-event="edit">显示</a>
                {elseif condition="$v.status eq 1"/}
                <a onclick="saveStatusVal(this,'{$v.id}',2)" data-url='{:url("Banner/saveStatus")}' class="layui-btn layui-btn-normal layui-btn-mini" lay-event="edit">不显示</a>
                {/if}

                <a class="layui-btn layui-btn-danger layui-btn-mini" onclick="deleteFuc(this,'{$v.id}')" data-url='{:url("Banner/delete")}'>删除</a>
            </div>
        </td>
    </tr>
    {/foreach}
    </tbody>
</table>


{/block}

{block name="javascript"}
<script src="__ADMIN__/js/fromCommon.js" charset="utf-8"></script>

<script>

</script>

{/block}